import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
  path: '/',
  redirect: '/recommend'
}, {
  path: '/recommend',
  name: 'Recommend',
  component: () => import('../views/Recommend.vue'),
  children: [{
    path: 'details/:id/:type',
    name: 'Details',
    component: () => import('../views/Detail.vue')
  }]
}, {
  path: '/rank',
  name: 'Rank',
  component: () => import('../views/Rank.vue')
}, {
  path: '/search',
  name: 'Search',
  component: () => import('../views/Search.vue')
}, {
  path: '/singer',
  name: 'Singer',
  component: () => import('../views/Singer.vue')
}]

const router = new VueRouter({
  routes
})

export default router
